/*
 * Copyright(C) 2012 Luvina Software Company
 *
 * TblUserLogic.java, May 28, 2012 HaiPD
 */
package net.luvina.manageuser.logic;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import net.luvina.manageuser.dto.UserDetailDto;
import net.luvina.manageuser.hibernate.TblDetailUserJapan;
import net.luvina.manageuser.hibernate.TblUser;

/**
 * Interface TblUserLogic
 * 
 * @author HaiPD
 * 
 */
public interface TblUserLogic {
	/**
	 * Method getListUser
	 * 
	 * @param offset
	 *            offset
	 * @param limit
	 *            limit
	 * @param groupId
	 *            groupId
	 * @param fullName
	 *            fullName
	 * @param sortType
	 *            sortType
	 * @param sortByFullName
	 *            sortByFullName
	 * @param sortByCodeLevel
	 *            sortByCodeLevel
	 * @param sortByEndDate
	 *            sortByEndDate
	 * @return List UserDetailDto
	 */
	public List<UserDetailDto> getListUser(int offset, int limit, int groupId,
			String fullName, String sortType, String sortByFullName,
			String sortByCodeLevel, String sortByEndDate);

	/**
	 * method getTotalRecords
	 * 
	 * @param groupId
	 *            groupId
	 * @param full_name
	 *            full_name
	 * @return int total records
	 */
	public int getTotalRecords(int groupId, String full_name);

	/**
	 * check existed login name
	 * 
	 * @param userId
	 *            user id
	 * @param loginName
	 *            login name
	 * @return true if login name exist
	 */
	public boolean checkExistedLoginName(int userId, String loginName);

	/**
	 * check existed email
	 * 
	 * @param userId
	 *            user id
	 * @param email
	 *            email
	 * @return true if email exist
	 */
	public boolean checkExistedEmail(int userId, String email);

	/**
	 * create user
	 * 
	 * @param tblUser
	 *            object user
	 * @return true if sucess
	 */
	@Transactional
	public boolean createUser(TblUser tblUser);

	/**
	 * create details user japan
	 * 
	 * @param tblDetailUserJapan
	 *            object TblDetailUserJapan
	 * @return true if not error
	 */
	public boolean createDetailUserJapan(TblDetailUserJapan tblDetailUserJapan);
}
